package com.example.larou.mapper;

import com.example.larou.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface UserMapper {
    @Insert("insert into larou.user(email,password,username,phone_number) VALUES (#{email},#{password},#{username},#{phone_number})")
    boolean Register(@Param("email") String email ,@Param("password") String password,@Param("username") String username,@Param("phone_number") String phone_number);
    @Select("select email from larou.user where email=#{email}")
    String getEmail(@Param("email") String email);
    @Select("select password from larou.user where email=#{email}")
    String getPassword(@Param("email") String email);
    @Select("select user_id from larou.user where email=#{email}")
    String getUser_id(@Param("email") String email);
    @Select("select user_id from larou.user where user_id=#{user_id}")
    boolean selectUserId(@Param("user_id") int user_id);
    @Select("select email from larou.user where user_id=#{user_id}")
    String selectEmail(@Param("user_id") int user_id);
}
